package DesignPatterns.CombinationMode;

import java.util.ArrayList;
import java.util.List;

public class Cuisine extends Component{
    String Name;
    String Des;

    @Override
    public String toString() {
        return "Cuisine{" +
                "list=" + list +
                '}';
    }

    public Cuisine(String name, String des) {
        super(name, des);

    }

    List<Component> list=new ArrayList<>();
    @Override
    public void add(Component component) {
        list.add(component);
    }

    @Override
    public void remove(Component component) {
        list.remove(component);
    }

    @Override
    public void show() {
        System.out.println(this.getName());
        for (Component component : list) {
            component.show();
        }
    }


    @Override
    public void setName(String name) {
        Name = name;
    }

    @Override
    public void setDes(String des) {
        Des = des;
    }

    public void setList(List<Component> list) {
        this.list = list;
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public String getDes() {
        return Des;
    }

    public List<Component> getList() {
        return list;
    }
}
